<template>
	<div>
		<h4>{{name}}</h4>
		<h4>{{age}}</h4>
		<button @click="getName">{{ name }}</button>
		<button @click="getAge">{{age}}</button>
	</div>
</template>
<script>
import axios from 'axios';
export default {
	data(){
		return {
			name:'',
			age: 0
		}
	},
	methods: {
		getName(){
			axios.get('/name')
				.then( res => this.name = res)
				.catch( err => console.log(err) );
		},
		getAge(){
			axios.get('/age')
				.then( res => this.age = res)
				.catch( err => console.log(err) );
		}
	},
}
</script>